package org.example.hello1_simpleMode;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消费者(直连模式)，rabbitTemplate直接往这个队列发信息（使用了默认的交换机）
 */
@Component
@RabbitListener(queuesToDeclare = {@Queue("hello_queue")})
public class SimpleCoustmer {

    @RabbitHandler
    public void receiveMessage(String body){
        System.out.println("Simple-消费者收到消息，内容为："+body);

    }
}
